package cn.xi.controller;

import cn.xi.checkItem.SetmealService;
import cn.xi.constant.MessageConstant;
import cn.xi.entity.PageResult;
import cn.xi.entity.QueryPageBean;
import cn.xi.entity.Result;
import cn.xi.pojo.Setmeal;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/setmeal2")
public class SetmealController2 {

    @Reference
    private SetmealService setmealService;

    @RequestMapping("/getSetmeal")
    public PageResult getSetmeal() {
        QueryPageBean queryPageBean = new QueryPageBean(1, 1000);
        return setmealService.pages(queryPageBean);
    }

    @RequestMapping("/findById")
    public Result findById(Integer id) {
        try {
            Setmeal byId = setmealService.findById(id);
            return new Result(true, "成功",byId);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,"失败");
        }

    }


}
